package dao;

import mappers.OneMapper;
import model.One;
import org.apache.ibatis.session.SqlSession;
import util.MyBatisUtil;

public class OneDAO {
    public One getOneById(int id) {
        SqlSession sqlSession = MyBatisUtil.getSqlSessionFactory().openSession();
        try {
            OneMapper oneMapper = sqlSession.getMapper(OneMapper.class);
            return oneMapper.getOneById(id);
        }
        finally {
            sqlSession.close();
        }
    }
}
